//
//  LFGuiViewController.m
//  LocalLife
//
//  Created by 李立达 on 15/11/22.
//  Copyright © 2015年 heima11. All rights reserved.
//

#import "LFGuiViewController.h"
#import <UIKit/UIKit.h>
#define ImageNumber 3
@interface LFGuiViewController ()

@end

@implementation LFGuiViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    UIScrollView *scroll=[[UIScrollView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    scroll.contentSize=CGSizeMake(KscreedWdith*3, 0);
    scroll.pagingEnabled=YES;
    scroll.userInteractionEnabled=YES;
    
    scroll.bounces = NO;

    
    [self.view addSubview:scroll];
    
    
    for (int i=0; i<ImageNumber; i++) {
        UIImageView *image=[[UIImageView alloc]initWithFrame:CGRectMake(i*KscreedWdith, 0, KscreedWdith, KscreedHeight)];
        NSString *scrollname=[NSString stringWithFormat:@"guide_%d",i];
        
        image.image=[UIImage imageNamed:scrollname];
        
        [scroll addSubview:image];
        image.userInteractionEnabled=YES;
        
        if(i==2)
        {
            UITapGestureRecognizer *tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapClick)];
            [scroll addGestureRecognizer:tap];
        }
        
    }
}

-(void)tapClick
{
    [[NSUserDefaults standardUserDefaults]setBool:YES forKey:ScrollViewIDF];
    
    [[NSNotificationCenter defaultCenter]postNotificationName:ScrollViewIDF object:nil];
}

@end
